package com.sport.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.sport.service.CaptchaService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/captcha")
@SaIgnore
public class CaptchaController {

    private final CaptchaService captchaService;
    public CaptchaController(CaptchaService captchaService) {
        this.captchaService = captchaService;
    }

    @SaIgnore
    @GetMapping("/sms-captcha/{phone}")
    public void getSmsCaptcha(@PathVariable String phone) {
        System.out.println("phone:"+phone);
        captchaService.getSmsCaptcha(phone);
    }
}
